package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.China;
import com.ruoyi.system.service.IChinaService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/system/china")
public class ChinaController extends BaseController {

    @Resource
    IChinaService chinaService;

    @GetMapping("/list")
    public TableDataInfo list(China china) {
        if (china.getPid() == null) {
            china.setPid(0L);
        }
        List<China> list = chinaService.selectChinaList(china);
        return getDataTable(list);
    }
}
